package com.lb.excel;

import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author: zhangjun
 * @date: 2024/08/01
 */
public class Hutool3Test {
    public static void main(String[] args) {
        ExcelReader reader = ExcelUtil.getReader("C:\\software\\1.xlsx");
        ExcelReader reader2 = ExcelUtil.getReader("C:\\software\\2.xlsx");
        List<Tid> readAll = reader.readAll(Tid.class);
        List<Tid> readAll2 = reader2.readAll(Tid.class);
        Set<String> collect = readAll2.stream().map(Tid::getTid).collect(Collectors.toSet());
        System.out.println(collect.size());
        for (String tid : collect) {
            for (Tid tid1 : readAll) {
                if (StrUtil.equals(tid1.getTid(), tid)) {
                    System.out.println(tid1.getPrice());
//                    System.out.println("tid:" + tid + ", price:" +tid1.getPrice());
                }
            }
        }
//        for (Tid tid : readAll2) {
//            System.out.println("业务tid：" + tid);
//            for (Tid tid1 : readAll) {
//                if (StrUtil.equals(tid1.getTid(), tid.getTid())) {
//                    System.out.println();
//                    if (tid.getPrice() == tid1.getPrice()) {
//                        System.out.println("金额相同：tid:" + tid.getTid() + ",tid-price:" + tid.getPrice() + ", tid1-price:" + tid1.getPrice());
//                    }
//                    if (tid.getPrice() != tid1.getPrice()) {
//                        System.out.println("金额不相同：tid:" + tid.getTid() + ",tid-price:" + tid.getPrice() + ", tid1-price:" + tid1.getPrice());
//                    }
//                }
//            }
//        }
    }
}
